<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head th:replace="fragment :: head(~{::title})">
    <title>添加友链</title>
</head>

<body>

<!--导航-->
<nav th:replace="admin/admin-fragment :: menu(2)" >

</nav>

<!--<div class="ui attached pointing menu">-->
<!--    <div class="ui container">-->
<!--        <div class="right menu">-->
<!--            <a href="#" th:href="@{/admin/tags/input}" class="teal active item">发布</a>-->
<!--            <a href="#" th:href="@{/admin/tags}" class="item">列表</a>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->

<!--中间内容-->
<div  class="m-container m-padded-tb-big">
    <div class="ui container">                         <!--如果没id，则进行新增，若有id，则进行更新-->
        <form action="#"  th:action="@{/admin/input}" method="post" class="ui form">

            <div class="required field">
                <div class="ui left labeled input">
                    <label class="ui teal basic label" >名称</label>
                    <input type="text" name="name"   placeholder="请输入友链名称" >
                </div>
            </div>
            <div class="required field">
                <div class="ui left labeled input">
                    <label class="ui teal basic label" >地址</label>
                    <input type="text" name="address"   placeholder="请输入友链地址" >
                </div>
            </div>


            <div class="ui error message"></div> <!--显示错误信息-->

            <!--        <div class="ui negetive message" th:unless="${#strings.isEmpty(msg)}">-->
            <!--          <i class="close icon"></i>-->
            <!--          <div class="header">验证失败：</div>-->
            <!--          <p th:text="${msg}">对不起，操作失败！</p>-->
            <!--        </div>-->

            <div class="ui right aligned container">

                <button type="button" id="save-btn" class="ui secondary submit button">提交</button>
            </div>

        </form>
    </div>
</div>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<!--底部footer-->
<footer th:replace="fragment :: footer" >

</footer>



<script>

    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
        on : 'hover'
    });

    $('.ui.form').form({
        fields : {
            title : {
                identifier: 'name',
                rules: [{
                    type : 'empty',
                    prompt: '请输入友链名称'
                }]
            },
            title : {
                identifier: 'address',
                rules: [{
                    type : 'empty',
                    prompt: '请输入友链地址'
                }]
            }
        }
    });


</script>
</body>
</html>
